Skip to content

feat(live-share): add temporary collaboration rooms#203

Merged
ThisIs-Developer merged 21 commits into
mainfrom
codex/live-share
Jul 2, 2026
Merged

feat(live-share): add temporary collaboration rooms#203
ThisIs-Developer merged 21 commits into
mainfrom
codex/live-share

Conversation

@ThisIs-Developer

Copy link
Copy Markdown
Owner

What changed

  • Added a separate Share Snapshot / Live Share UI so permanent URL snapshots remain distinct from temporary collaboration rooms.
  • Added Yjs + y-webrtc live text sync for the active Markdown tab, with room secrets kept in the URL fragment and no document persistence for active live-room edits.
  • Added a stateless Cloudflare Pages WebSocket signaling function at /live-signal for peer discovery only.

Why

Live collaboration needs temporary signaling for WebRTC peer discovery, but the Markdown document should not be stored in a database, server file, or persistent document backend.

Impact

Users can start a temporary editable room, copy a #live=room.secret invite link, and collaborate on Markdown text while the room is active. Everyone with the live room link can edit.

Validation

  • node --check script.js
  • node --check functions/live-signal/[[path]].js
  • git diff --check
  • Browser smoke test on a fresh localhost origin: Live Share modal opens, session starts, invite link is generated, no fresh console errors.
  • Two-tab smoke test: Markdown typed in the host tab synced to the joined tab through Yjs.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment Jul 2, 2026 9:11pm

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploying markdown-viewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: f5e7771
Status: ✅  Deploy successful!
Preview URL: https://23c46850.markdown-viewer.pages.dev
Branch Preview URL: https://codex-live-share.markdown-viewer.pages.dev

View logs

@ThisIs-Developer

Copy link
Copy Markdown
Owner Author

Follow-up for cross-user Live Share behavior:

  • Added a Durable Object-backed signaling worker/config so /live-signal can coordinate WebSocket peers through one shared room broker instead of relying on per-isolate in-memory Maps.
  • Kept the Pages Function path as the app endpoint and forward to LIVE_SIGNAL_ROOMS when the binding is configured.
  • Added the public y-webrtc signaling URL only as an additional fallback, not as the primary reliability mechanism.
  • Switched generated participant names to crypto-backed adjective+noun combinations and disabled browser autofill on the display name field.
  • Added compact participant avatars in the toolbar/modal with a +N overflow pattern and Yjs-backed in-memory participant heartbeat state.

Validation:

  • node --check script.js
  • node --check functions/live-signal/[[path]].js
  • node --check workers/live-signal-worker.js
  • git diff --check

Note: the in-app browser automation exposes a single tab id when asked to open multiple tabs, so I could not use it as a trustworthy two-client remote-collaboration test. The previous same-browser sync result was not a valid proof of cross-user signaling.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 55468b7
Status: ✅  Deploy successful!
Preview URL: https://70d55c4e.markdownviewer.pages.dev
Branch Preview URL: https://codex-live-share.markdownviewer.pages.dev

View logs

@ThisIs-Developer

Copy link
Copy Markdown
Owner Author

Deploy-fix follow-up:

Cloudflare Pages failed because the root wrangler.toml made Pages try to bind LIVE_SIGNAL_ROOMS to script_name = markdown-viewer-live-signal, but that Worker does not exist in the account yet:

Error 8000109: Script markdown-viewer-live-signal not found

I removed the root Pages wrangler.toml so Pages can deploy using the existing project configuration again. The optional Durable Object worker config remains in wrangler.live-signal.toml for a separate/manual signaling-worker deployment later, without blocking the Pages preview.

Validation after the fix:

  • node --check script.js
  • node --check functions/live-signal/[[path]].js
  • node --check workers/live-signal-worker.js
  • git diff --check

@ThisIs-Developer ThisIs-Developer marked this pull request as ready for review July 1, 2026 16:29
@ThisIs-Developer ThisIs-Developer changed the title [codex] Add temporary live share rooms feat(live-share): add temporary collaboration rooms Jul 2, 2026
@ThisIs-Developer ThisIs-Developer merged commit a974437 into main Jul 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant